<%@ page import="org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest" %>
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"><!--<![endif]-->
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title><g:layoutTitle default="Grails"/></title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="shortcut icon" href="${resource(dir: 'images', file: 'favicon.ico')}" type="image/x-icon">
  <link rel="apple-touch-icon" href="${resource(dir: 'images', file: 'apple-touch-icon.png')}">
  <link rel="apple-touch-icon" sizes="114x114" href="${resource(dir: 'images', file: 'apple-touch-icon-retina.png')}">
  <link rel="stylesheet" href="${resource(dir: 'css', file: 'main.css')}" type="text/css">
  <link rel="stylesheet" href="${resource(dir: 'css', file: 'mobile.css')}" type="text/css">
  <link href="http://fonts.googleapis.com/css?family=Arvo" rel="stylesheet" type="text/css"/>

  <g:layoutHead/>
  <r:layoutResources/>
</head>

<body>

<div id="bg">
  <div id="outer">
    <div id="header">
      <div id="logo">
        <h1>
          <a href="#"><g:message code="app.logo"/></a>
        </h1>
      </div>

      <g:set var="currentController" value="${GrailsWebRequest.lookup().controllerName}"/>
      <div id="nav">
        <ul>
          <sec:ifAllGranted roles="ROLE_USER">

            <li class="first ${!currentController ? 'active' : ''}">
              <a href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a>
            </li>
            <li class="${currentController == 'feed' ? 'active' : ''}">
              <g:link controller="feed" action="list"><g:message code="menu.feeds" default="Feeds"/></g:link>
            </li>
            <li class="${currentController == 'subscription' ? 'active' : ''}">
              <g:link controller="subscription" action="list"><g:message code="menu.subscriptions"/></g:link>
            </li>
            <li class="${currentController == 'myProfile' ? 'active' : ''}">
              <g:link controller="myProfile" action="edit"><g:message code="menu.profile"/></g:link>
            </li>
            <li>
              <a href="#"><g:message code="menu.feedEntries"/></a>
            </li>

          </sec:ifAllGranted>
          <sec:ifAllGranted roles="ROLE_ADMIN">
            <li class="first ${currentController == 'stats' ? 'active' : ''}">
              <g:link controller="stats" action="index"><g:message code="menu.stats"/></g:link>
            </li>
            <li class="first ${currentController == 'user' ? 'active' : ''}">
              <g:link controller="user" action="search"><g:message code="spring.security.ui.menu.users"/></g:link>
            </li>
          </sec:ifAllGranted>

          <sec:ifLoggedIn>
            <li>
              <g:link controller="logout" action="index"><g:message
                      code="menu.logout"/></g:link>
            </li>
          </sec:ifLoggedIn>
        </ul>

        <br class="clear"/>
      </div>
    </div>
    %{--
                    <div id="banner">
                        <img src="images/pic1.jpg" width="1120" height="200" alt="" />
                    </div>
    --}%
    <div id="main" class="main">
      <div id="sidebar">
        <sec:ifLoggedIn>
        <h3>
          Welcome to Kindle RSS
          <sec:username/>
        </h3>
        </sec:ifLoggedIn>
      </div>

      <div id="content">
        <div id="box1">
          <g:layoutBody/>
        </div>
        <br class="clear"/>
      </div>
      <br class="clear"/>
    </div>
  </div>

  <div id="copyright">
  &copy; Kindle RSS | Design by <a href="http://www.freecsstemplates.org/">FCT</a>
  </div>
</div>

<div id="spinner" class="spinner" style="display:none;"><g:message code="spinner.alt" default="Loading&hellip;"/></div>
<g:javascript library="application"/>
<r:layoutResources/>
</body>
</html>
